/**
 * Copyright © 2014 TingerSure. All rights reserved.
 */
package org.sure.scomet.link.callback;

import javax.servlet.http.HttpSession;

/**
 * The door class of project SComet. It has lots of method to communicate with
 * others. The implement class should write in the config file
 * "src/scomet.properties".
 * 
 * @author TingerSure
 */
public interface SComet {
	/**
	 * This method should be over write to tell SComet how to do when a message
	 * comes from Client.
	 * 
	 * @param id
	 *            page id
	 * @param session
	 *            the user session
	 * @param message
	 *            the message.
	 */
	public void message(int id, HttpSession session, String message);

	/**
	 * This method should be over write to tell SComet what SComet need to do
	 * when Client send a link request to Server.
	 * 
	 * @param id
	 *            page id
	 * @param session
	 *            the user session
	 */
	public void linked(int id, HttpSession session);

	/**
	 * This method should be over write to tell SComet whether SComet need to
	 * reply to the request.
	 * 
	 * @param id
	 *            page id
	 * @param session
	 *            the user session
	 * @return reply or not
	 */
	public boolean role(int id, HttpSession session);

	/**
	 * This method should be over write to tell SComet what SComet need to do
	 * when this link is closed.
	 * 
	 * @param id
	 *            page id
	 */
	public void connectionClose(int id);

}
